<template>
  <div class="goodsListItem flex f-b f-cl" @click="itemClick">
      <div>
          <img :src="imgSrc" alt="1">
            <p>{{goodsItem.title}}</p>
      </div>
        <div class="wenzi flex f-b">
        <span class="price">￥{{goodsItem.price}} </span>
        <span class="shouchang">★{{goodsItem.cfav}} </span>
        </div>
  </div>
</template>

<script>
export default {
    name:'goodsListItem',
    props:['goodsItem'],
    methods:{
        itemClick(){
            this.$router.push('/detail/'+this.goodsItem.iid)
        }
    },
    computed:{
        imgSrc(){
            return this.goodsItem.show?this.goodsItem.show.img:this.goodsItem.image
        }
    }
}
</script>

<style scoped>
    img{
        width: 100%;
      
    }
    .goodsListItem{
        width: 40%;
        margin-top: 15px;
        background-color: #fff;
        padding:15px;
        border-radius: 4%;
       
       
    }
    .goodsListItem p{
        color:rgb(49, 49, 49);
        white-space: nowrap;
        overflow:hidden;
        text-overflow:ellipsis;
    }
    .price{
        color: rgb(241, 62, 62);
    }
    .shouchang{
        color: rgb(255, 123, 0);
    }
    
</style>